<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>主轴与侧轴对齐方式</title>
    <style>
        .box1 {
            display: flex;
            /* justify-content: start; */
            /* justify-content: end; */
            /* justify-content: center; */


            /* 父级剩余尺寸分配成间距 */
            /* 弹性盒子左右间距相等 */
            /* justify-content: space-around; */

            /* 弹性盒子间距相等 */
            /* justify-content: space-between; */

            /* 弹性盒子之间间距与边界距离相等 */
            justify-content: space-evenly;
            width: 1200px;
            height: 300px;
            background-color: pink;
        }
        .box1 div {
            width: 200px;
            height: 150px;
            background-color: orange;
        }

        .box2 {
            display: flex;
            /*弹性盒子在侧轴没有尺寸才会被拉伸 */
            /* align-items: stretch; */

            /* align-items: center; */

            /* align-items: flex-start; */

            align-items: flex-end;
            width: 1200px;
            height: 500px;
            background-color: yellow;
        }

        .box2 div {
            width: 200px;
            height: 200px;
            background-color: red;
        }
        .box2 div:nth-child(2) {
            align-self: center;
        }
    </style>
</head>
<body>
    <div class="box1">
        <div></div>
        <div></div>
        <div></div>
        <div></div>
    </div>
    <div class="box2">
        <div></div>
        <div></div>
        <div></div>
        <div></div>
    </div>
</body>
</html>